package com.my.controller.System;


import com.my.bean.MenuResourse;
import com.my.bean.Role;
import com.my.bean.ZtreeBean;
import com.my.service.MenuResourseService;
import com.my.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * <p>
 * 菜单资源表 前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2018-08-26
 */
@Controller
@RequestMapping("/menuResourse")
public class MenuResourseController {
    @Autowired
    MenuResourseService menuResourseService;
    @RequestMapping("/insertMenu")
    @ResponseBody
    public boolean insertMenu(){
        MenuResourse menuResourse=new MenuResourse();
          menuResourse.setMenuClass("icon-double-angle-right");
        menuResourse.setMenuName("宝宝护理记录存储");
        menuResourse.setMenuLev(2);
        menuResourse.setMenuUrl("xxxx.html");
        menuResourse.setMenuType(1);
        return menuResourseService.insert(menuResourse);

    }
    //查询所有角色  如果带分页参数 就分页  如果不带分页参数  就不分页
    @RequestMapping("/findMenuZtree")
    @ResponseBody
    public List<ZtreeBean> findRole(){
        return  menuResourseService.findMenuZtree();
    }
}
